#ifndef _CDSF_TIMER_H_
#define _CDSF_TIMER_H_

#include "CDSF_Includes.h"
#include "CDSF_Types.h"
#include "CDSF_ErrorCode.h"

typedef float SFTimeInterval;
typedef void (* SFTimerFunction)(void *data);

/* SFTimerSchedule, SFTimerUnschedule, SFTimerFire MUST be called by one thread */
extern SFCode SFTimerSchedule(SFTimerFunction func, SFTimeInterval time, void *data);
extern SFCode SFTimerUnschedule(SFTimerFunction func);
extern void SFTimerFire();

/* called by SFAppStart */
extern SFCode SFTimerInit(SFClockRate rate);

/* called by the interupt handler */
extern SFCode SFTimerDelegate(void);

#endif